Skip to content

fix(ios): mark the keyboard intro sheets as shown before a simulator launch - #5062

Merged
thymikee merged 6 commits into
callstack:mainfrom
imranbarbhuiya:feat/ios-sim-keyboard-intro
Nov 27, 2026
Merged

thymikee merged 6 commits into
callstack:mainfrom
imranbarbhuiya:feat/ios-sim-keyboard-intro

Conversation

@imranbarbhuiya

@imranbarbhuiya imranbarbhuiya commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part of #4569. Left: a snapshot/alert fallback for a sheet that still appears.

On a fresh simulator, the first text entry brings up the swipe-typing introduction, and on a keyboard with a second language the "Type English and Polish" tip. Both cover the keyboard. iOS 26.2 and 27.2 store them in com.apple.keyboard.preferences as DidShowContinuousPathIntroduction and MultilingualKeyboardTip, read back after each sheet.

open writes both keys after boot, once per open, alongside the accessibility preparation. It skips keys this host's copy of the preferences already has, so a local simulator writes after an erase. A Limrun simulator, which the host cannot read, gets both on every open; both preparations share one write helper. A failed write only warns. Writes get 15 s: one took 8-12 s right after a first boot, and a write stopped at its timeout does not land.

Rejected: dismissing the sheets after they appear, a check on every text entry.

Before / after

Newly erased iPhone 17 Pro simulator, iOS 26.2, English and Polish keyboards, node bin/agent-device.mjs. Base, built at 63fe1b6:

$ agent-device open com.apple.Preferences && agent-device fill 'role=search' wifi
Filled 4 chars
$ agent-device snapshot -i | grep -E 'Speed up|Continue|Type English|search\]'
@e14 [search] "wifi" [focused] [editable]
@e24 [text] "Speed up your typing by sliding your finger across the letters to compose a word."
@e25 [button] "Continue"
@e28 [text] "Type English and Polish"
@e30 [button] "Continue"

Head, built at ad03825, same setup:

$ agent-device open com.apple.Preferences && agent-device fill 'role=search' wifi
Filled 4 chars
$ agent-device snapshot -i | grep -E 'Speed up|Continue|Type English|search\]'
@e14 [search] "wifi" [focused] [editable]

On iOS 27.2, base shows the swipe-typing sheet; head shows neither, also with Polish, rechecked at 4ec0d4b.

Validation

  • Head 4ec0d4bce: check:affected --run --head passed format, lint, typecheck, layering, fallow, build and vitest-related; the later pnpm gate stages (provider-integration, command-docs, docs-links, docs-prose and the rest) passed.
  • New ios-simulator-keyboard.test.ts and Limrun tests; mutants on the shared write helper, once-per-open, timeout, and failure handling each fail a test.

@thymikee

Copy link
Copy Markdown
Member

Thanks for working on the keyboard intro sheets.

At 7a4865d, the fix is not proven on the OS that issue #4569 names. KEYBOARD_INTRO_KEYS was read back on iOS 27.2 only, and the issue was reported on iOS 26.2. If iOS 26 uses another key or domain, open writes keys the keyboard ignores. The sheet would still cover the first fill, while the help and docs say it does not. The PR body also lists the iOS 26.2 run as left. Please post a live run on a newly erased iOS 26.2 simulator with two keyboard languages (for example English and Polish). Use the head build via node bin/agent-device.mjs, then open com.apple.Preferences, fill 'role=search' wifi and snapshot -i. The snapshot must show no 'Speed up your typing', 'Continue' or 'Type English and …' nodes. Please also show the base build with the sheet on the same setup. If iOS 26 needs other keys, add them to KEYBOARD_INTRO_KEYS. This run is required before merge.

Could writtenRemoteKeys be deleted, so both keys are written on every remote open like the accessibility prep? One shared guest bool-preference write helper could then serve this and enableIosSimulatorAppAccessibility. That would remove the module-global state and the remote-only test branch.

Not verified here: tests and device runs were not performed, and the iOS 27.2 transcript and the 8-12 s write timing come from the author. Not verified here: the keys and domain on iOS 26.x, and whether runXcrun rejects on a non-zero exit under the Limrun scoped provider. If it resolves, a failed remote write would be cached as written.

Only the two 'Body rules' runs are not passing, and both are cancelled runs superseded by PR body edits. That job checks the PR description, not code, and the diff does not touch it. The other 16 checks pass. There are no conflicts. The next step before merge is the live iOS 26.2 run described above.

@imranbarbhuiya

Copy link
Copy Markdown
Contributor Author
  • Done in ad03825: writtenRemoteKeys is gone, so a Limrun simulator gets both keys on every open, like the accessibility preparation. enableSimulatorBoolPreference in simulator-preferences.ts now does the guest defaults write for both enableIosSimulatorAppAccessibility (still 2 s) and the keyboard keys (15 s). The remote-only cache test is deleted.

  • runXcrun rejects on a non-zero exit under the Limrun provider: its simctl adapter throws COMMAND_FAILED unless allowFailure is set. A new test in limrun-ios-tools.test.ts pins this for a defaults write, and ios-simulator-keyboard.test.ts checks that a non-zero write warns with its key.

  • iOS 26.2 (23C54), a new iPhone 17 Pro simulator (erased again before the head run) with English and Polish keyboards. Settings' Keyboard pane stayed blank on this runtime, so the two keyboards (ml=1 English and Polish) went in through the simulator's AppleKeyboards preferences before the first open, then a reboot; the base run shows the multilingual tip and the keyboard reads EN PL, as after adding Polish in Settings on 27.2. iOS 26.2 uses the same two keys: after the base run, the keyboard had written DidShowContinuousPathIntroduction and MultilingualKeyboardTip to com.apple.keyboard.preferences, so KEYBOARD_INTRO_KEYS is unchanged.

    Base, built at 63fe1b6:

    $ agent-device open com.apple.Preferences && agent-device fill 'role=search' wifi
    Filled 4 chars
    $ agent-device snapshot -i | grep -E 'Speed up|Continue|Type English|search\]'
    @e14 [search] "wifi" [focused] [editable]
    @e24 [text] "Speed up your typing by sliding your finger across the letters to compose a word."
    @e25 [button] "Continue"
    @e28 [text] "Type English and Polish"
    @e30 [button] "Continue"
    

    Head, built at ad03825, same setup after an erase:

    $ agent-device open com.apple.Preferences && agent-device fill 'role=search' wifi
    Filled 4 chars
    $ agent-device snapshot -i | grep -E 'Speed up|Continue|Type English|search\]'
    @e14 [search] "wifi" [focused] [editable]
    

@thymikee

Copy link
Copy Markdown
Member

Thanks for the fixes. At ad03825 both earlier findings are closed, and the code looks good to me. No conflicts are known. The only non-passing check is Body rules, which was cancelled after the PR description edits; it checks the description, and the diff touches no workflow or body-rules code, so it looks unrelated. The other 15 checks pass. Not verified here: the iOS 26.2 and 27.2 base and head transcripts and the read-back of both keys on 26.2 are author-supplied, no device run was performed in this review, the 8-12 s first-boot write timing is the author's measurement, and tests were not run locally. Nothing else blocks this PR, so it is ready for the maintainer.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 24, 2026
@thymikee

Copy link
Copy Markdown
Member

This branch now conflicts with main at ad03825. Please rebase onto current main; the review at ad03825 was clean, so only a check that the rebase keeps the same behavior is needed.

@imranbarbhuiya
imranbarbhuiya force-pushed the feat/ios-sim-keyboard-intro branch from ad03825 to 6f362aa Compare November 25, 2026 07:45
@imranbarbhuiya

Copy link
Copy Markdown
Contributor Author

Rebased onto main at c8555bd (after #5081); the head is now 6f362aa.

  • One conflict, in src/commands/schema/cli-help.ts, hit twice (by 908630d and e6447db): fix(daemon): name a sandbox-denied loopback listen and point at host access #5081 rewrote the daemon startup line directly above our iOS simulator open line. I kept main's startup line with startup-listen-denied and this branch's keyboard intro sentence. git range-diff shows only that context line changed; the other commits apply unchanged, and website/docs/docs/commands.md merged cleanly.
  • check:affected --run --head 6f362aaa2 passed format, lint, typecheck, layering, fallow, build and vitest-related, and the later pnpm gate stages passed (provider-integration, daemon-wire-compat, command-docs, docs-links, docs-prose and the rest).

On an iPhone 17 Pro simulator, iOS 27.2, with English and Polish keyboards and both keys removed from com.apple.keyboard.preferences before boot, built at 6f362aa:

$ agent-device open com.apple.Preferences
Opened: com.apple.Preferences
$ xcrun simctl spawn <udid> defaults read com.apple.keyboard.preferences | grep -E 'DidShow|Multilingual'
    DidShowContinuousPathIntroduction = 1;
    MultilingualKeyboardTip = 1;
$ agent-device fill 'role=search' wifi
Filled 4 chars
$ agent-device press 'role=search' && agent-device keyboard status --json | grep visible
    "visible": true,
$ agent-device snapshot -i | grep -iE 'Speed up|Continue|Type English|search\]'
@e6 [search] "wifi" [focused] [editable]

The keyboard shows EN with the globe key, and neither sheet appears.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 25, 2026
@thymikee

Copy link
Copy Markdown
Member

Thanks for the rebase. The earlier conflict is resolved at 6f362aa, the rebased patch is logically the same, and no code problems remain.

All 17 checks pass. Not verified here: no device run or local test run was performed, and the iOS 26.2 (at ad03825) and 27.2 (at the current head) transcripts are author-supplied. This is ready for a maintainer.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 25, 2026
@thymikee

Copy link
Copy Markdown
Member

This branch now conflicts with main. Please rebase onto current main; the next review only checks that the rebase keeps the reviewed change intact.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 26, 2026
@imranbarbhuiya
imranbarbhuiya force-pushed the feat/ios-sim-keyboard-intro branch from 6f362aa to 4ec0d4b Compare November 26, 2026 14:13
@imranbarbhuiya

Copy link
Copy Markdown
Contributor Author

Rebased onto main (9f7751e) as 4ec0d4b. git range-diff shows four commits identical; the other two differ only in one context line of cli-help.ts, the daemon startup line that #5095 extended right above ours. No added or removed line changed. On a fresh iOS 27.2 simulator at the new head, open writes both keys and neither intro sheet appears on the first fill, also with Polish added.

@thymikee

Copy link
Copy Markdown
Member

Thanks for the update. No code problems were found at 4ec0d4b, and the required evidence is satisfied.

The conflict with main raised in the earlier comment is resolved: the added and removed lines of the change are identical, and upstream changes under platform-apple do not touch app launch, the preference modules, simulator boot or the tool provider.

Not verified here: no device run or local test run was performed, and the reported local gate and mutant results were not reproduced. The iOS 26.2 base and head evidence comes from ad03825, the iOS 27.2 transcript comes from 6f362aa, and the run at 4ec0d4b is available only as the author summary.

The Runner Build (tvOS, visionOS and watchOS) failure is likely unrelated. The parallel restore-and-build step hit an actions/cache download error (Directory not empty), the same job fails with that error on base 9f7751e under a different directory, and this PR changes no Swift, workflow or runner build input. The job did not complete at this commit, so it gives no build signal for those three platforms.

Nothing from the code review blocks the merge. If the Runner Build job is required, it needs a rerun, and then maintainer review comes next.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 26, 2026
@thymikee
thymikee merged commit 7d392e6 into callstack:main Nov 27, 2026
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants